package cn.zyy.hotel.service.impl;

import cn.zyy.hotel.dao.RoomMapper;
import cn.zyy.hotel.entity.Room;
import cn.zyy.hotel.service.RoomService;
import cn.zyy.hotel.vo.RoomVO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import javax.annotation.Resource;
import java.util.List;

@Service
@Transactional
public class RoomServiceImpl implements RoomService {

    @Resource
    private RoomMapper roomMapper;

    //查询房间列表
    public List<Room> selectRoomListByPage(RoomVO roomVo) {
        return roomMapper.selectRoomListByPage(roomVo);
    }

    //添加房间
    public int addRoom(Room room) {
        return roomMapper.addRoom(room);
    }

    //修改房间
    public int updateRoom(Room room) {
        return roomMapper.updateRoom(room);
    }

    //删除房间
    public int deleteRoomById(Integer id) {
        return roomMapper.deleteRoomById(id);
    }

    //根据楼层查询房间列表
    public List<Room> selectRoomList() {
        return roomMapper.selectRoomList();
    }

    //查询房间详情
    public Room selectById(Integer id) {
        return roomMapper.selectById(id);
    }


}
